/*
 * @Author: xiaosihan 
 * @Date: 2024-05-23 18:53:24 
 * @Last Modified by: xiaosihan
 * @Last Modified time: 2024-05-29 04:21:21
 */


// homeStore
import { observable, configure } from "mobx";
import { BarData } from "./component3d/BeijingMap/BarGroup/Bar";
import { InfoPointData } from "./type";
configure({ enforceActions: "never" });

// 公共状态管理
const homeStore = observable({

    // 鼠标滑过的区编码
    hoverAreaCode: "",
    setHoverAreaCode(hoverAreaCode: string) {
        this.hoverAreaCode = hoverAreaCode;
    },

    // 显示飞线
    showFlyLine: false,
    setShowFlyLine(show: boolean) {
        this.showFlyLine = show;
    },

    //显示散点
    showScatter: false,
    setShowScatter(show: boolean) {
        this.showScatter = show;
    },

    //显示点位
    showPoint: false,
    setShowPoint(show: boolean) {
        this.showPoint = show;
    },

    //显示粒子
    showsPrite: false,
    setShowsPrite(show: boolean) {
        this.showsPrite = show;
    },

    //柱状图数据
    barDatas: [] as Array<BarData>,
    setBarDatas(barDatas: Array<BarData>) {
        this.barDatas = barDatas;
    },

    //当前选中的信息点数据
    infoPoint: undefined as undefined | InfoPointData,
    setInfoPoint(infoPoint: undefined | InfoPointData) {
        this.infoPoint = infoPoint;
    },

    // 弹窗的位置
    modalPosition: { x: 0, y: 0 },
    setModalPosition(modalPosition: { x: number, y: number }) {
        this.modalPosition = modalPosition;
    }

    //地图偏移量
    // offset = new Vector3(-116.468994140625 * 5, 0, 40.25177764892578 * 5);


});

export default homeStore;